Optimal. Leaf size=62 \[ -\frac {2 a^2 \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2}}+\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {\cot (x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3790, 3789, 3770, 3831, 2660, 618, 206} \[ -\frac {2 a^2 \tanh ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2}}+\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {\cot (x)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 2660
Rule 3770
Rule 3789
Rule 3790
Rule 3831
Rubi steps
\begin {align*} \int \frac {\csc ^3(x)}{a+b \csc (x)} \, dx &=-\frac {\cot (x)}{b}-\frac {a \int \frac {\csc ^2(x)}{a+b \csc (x)} \, dx}{b}\\ &=-\frac {\cot (x)}{b}-\frac {a \int \csc (x) \, dx}{b^2}+\frac {a^2 \int \frac {\csc (x)}{a+b \csc (x)} \, dx}{b^2}\\ &=\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {\cot (x)}{b}+\frac {a^2 \int \frac {1}{1+\frac {a \sin (x)}{b}} \, dx}{b^3}\\ &=\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {\cot (x)}{b}+\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \frac {1}{1+\frac {2 a x}{b}+x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^3}\\ &=\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {\cot (x)}{b}-\frac {\left (4 a^2\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (1-\frac {a^2}{b^2}\right )-x^2} \, dx,x,\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{b^3}\\ &=\frac {a \tanh ^{-1}(\cos (x))}{b^2}-\frac {2 a^2 \tanh ^{-1}\left (\frac {b \left (\frac {a}{b}+\tan \left (\frac {x}{2}\right )\right )}{\sqrt {a^2-b^2}}\right )}{b^2 \sqrt {a^2-b^2}}-\frac {\cot (x)}{b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 106, normalized size = 1.71 \[ \frac {\csc \left (\frac {x}{2}\right ) \sec \left (\frac {x}{2}\right ) \left (2 a^2 \sin (x) \tan ^{-1}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )+\sqrt {b^2-a^2} \left (a \sin (x) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )-b \cos (x)\right )\right )}{2 b^2 \sqrt {b^2-a^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.67, size = 308, normalized size = 4.97 \[ \left [\frac {\sqrt {a^{2} - b^{2}} a^{2} \log \left (-\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \relax (x)^{2} + 2 \, a b \sin \relax (x) + a^{2} + b^{2} - 2 \, {\left (b \cos \relax (x) \sin \relax (x) + a \cos \relax (x)\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \relax (x)^{2} - 2 \, a b \sin \relax (x) - a^{2} - b^{2}}\right ) \sin \relax (x) + {\left (a^{3} - a b^{2}\right )} \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) - {\left (a^{3} - a b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) - 2 \, {\left (a^{2} b - b^{3}\right )} \cos \relax (x)}{2 \, {\left (a^{2} b^{2} - b^{4}\right )} \sin \relax (x)}, -\frac {2 \, \sqrt {-a^{2} + b^{2}} a^{2} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \relax (x) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \relax (x)}\right ) \sin \relax (x) - {\left (a^{3} - a b^{2}\right )} \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) + {\left (a^{3} - a b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \sin \relax (x) + 2 \, {\left (a^{2} b - b^{3}\right )} \cos \relax (x)}{2 \, {\left (a^{2} b^{2} - b^{4}\right )} \sin \relax (x)}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.35, size = 98, normalized size = 1.58 \[ \frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a^{2}}{\sqrt {-a^{2} + b^{2}} b^{2}} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{b^{2}} + \frac {\tan \left (\frac {1}{2} \, x\right )}{2 \, b} + \frac {2 \, a \tan \left (\frac {1}{2} \, x\right ) - b}{2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.21, size = 77, normalized size = 1.24 \[ \frac {\tan \left (\frac {x}{2}\right )}{2 b}+\frac {2 a^{2} \arctan \left (\frac {2 \tan \left (\frac {x}{2}\right ) b +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{b^{2} \sqrt {-a^{2}+b^{2}}}-\frac {1}{2 b \tan \left (\frac {x}{2}\right )}-\frac {a \ln \left (\tan \left (\frac {x}{2}\right )\right )}{b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.49, size = 135, normalized size = 2.18 \[ -\frac {1}{b\,\mathrm {tan}\relax (x)}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{b^2}-\frac {a^2\,\mathrm {atan}\left (\frac {a^2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,4{}\mathrm {i}-b^2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a\,b\,\sqrt {a^2-b^2}\,2{}\mathrm {i}}{4\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^3+2\,a^2\,b-3\,\mathrm {tan}\left (\frac {x}{2}\right )\,a\,b^2-b^3}\right )\,2{}\mathrm {i}}{b^2\,\sqrt {a^2-b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc ^{3}{\relax (x )}}{a + b \csc {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________